package com.yt.dor.service;

import com.yt.dor.models.vo.RoomLabelVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.dor.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.dor.mapper.RoomLabelMapper;
import com.yt.dor.models.service.IRoomLabelService;
import com.yt.dor.models.bo.RoomLabelSaveBO;
import com.yt.dor.models.dto.RoomLabelDTO;

import java.util.List;

/**
 * 房间标签详情控制器
 *
 * @author thekai
 * @Date 2025-10-29 11:21:19
 */
@DubboService
public class RoomLabelServiceImpl extends ServiceImpl<RoomLabelMapper, RoomLabelDTO> implements IRoomLabelService{

    @Resource
    private YmlConfig ymlConfig;
    @Resource
    private RoomLabelMapper roomLabelMapper;

    @Override
    public boolean add(RoomLabelSaveBO saveBO) {
        RoomLabelDTO dto = new RoomLabelDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
    @Override
    public List<RoomLabelVO> query() {
        List<RoomLabelVO> roomLabelVOS = roomLabelMapper.query();
        return roomLabelVOS;
    }
}
